// vite.config.ts
import { defineConfig, loadEnv } from 'vite'
import uni from "@dcloudio/vite-plugin-uni"
import Components from '@uni-helper/vite-plugin-uni-components'
import { WotResolver } from '@uni-helper/vite-plugin-uni-components/resolvers'

export default defineConfig(({ mode }) => {
  
  return {
    plugins: [
      Components({
        resolvers: [WotResolver()]
      }), 
      uni()
    ],
    server: {
      proxy: {
        '/yuan-code': {
          target: 'http://localhost:8080',  // 直接使用 VITE_APP_BASE_URL
          changeOrigin: true
        }
      }
    }
  }
})
